<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ taglib prefix="map" uri="/map" %>  
<%
	String basepath = request.getContextPath();
%>

<script type="text/javascript">

$(function(){
	
	var config = ${map:json(config)};
	
	loader.load(basepath+"/"+config["module.namespace"]+"/"+"user.js",function(){
		
		var module = new user();
		
		app.module=module;
		
		app.module.init(config);

	});
	
});

</script>

<!-- 查询区 -->
<div class="core-panel" fit="false" style="padding:2px;">
    <form class="core-form c3" id="listForm" type="query">
    	<table>
			<tr>
			  <td>用户名称：</td><td><input name="USER_NAME" ></td>
			  <td>用户账号：</td><td><input name="USER_ACCOUNT" ></td>
			  <td>用户状态：</td><td>
				  <select name="SJZT" onchange="app.module.query()">
				  <option value="">--全部--</option>
				  <option value="1">未激活</option>
				  <option value="9">已激活</option>
				  </select>
			  </td>
			  
			  <td><a class="core-button" icon="icon-query" id="query" href="javascript:app.module.query();">查询</a></td>
			</tr>
		</table>
    </form>
</div>	

<div class="blank5"></div>


<!-- 列表按钮区 -->
<c:if test="${map:isNotEmpty(module_rights) }">
	
	<div class="core-panel" fit="false" style="padding:4px;">
	    <c:if test="${map:has(module_rights,'B-G-E') }">
			<c:if test="${user.USER_RIGHT==8 }">
				<a class="core-button" icon="icon-add" type="list" id="add" onclick="app.module.add($(this))">添加</a>
			</c:if>
			<a class="core-button" icon="icon-del" id="del" type="list" onclick="app.module.del($(this))">删除</a>
		</c:if>
		<c:if test="${map:has(module_rights,'B-G-L') }">
			<a class="core-button" icon="icon-lock" id="lock"  type="list" onclick="app.module.lock($(this))">激活</a>
			<a class="core-button" icon="icon-unlock" id="unlock"  type="list" onclick="app.module.unlock($(this))">取消激活</a>
		</c:if>
	</div>
</c:if>	
<div style="width:630px;" class="fl">
<div class="blank5"></div>
	<!-- 列表区 -->
	<table class="core-grid" id="list" title="${module.MODULE_NAME}列表" url="<%=basepath %>/${config['module.namespace']}/list" idField="${config['module.idCol']}" pagination="true" style="height:405px;" clickList="app.module.clickList" listLoaded="app.module.listLoaded" listParams="app.module.listParams" >
		<thead>
			<tr>
				<th field="USER_ID" checkbox="true"></th>
				<th field="USER_NAME" width="120" >用户名称</th>
				<th field="USER_ACCOUNT" width="100" >登录账号</th>
				<th field="ROLE_NAME" width="100" align="center" >用户角色</th>
				<th field="SJZT" width="100" align="center" formatter="app.module.formatSjzt">用户状态</th>
			</tr>
		</thead>
	</table>
</div>
<div class="fr" style="width:365px;">
<div class="blank5"></div>
<!-- 表单区 -->
<div id="tabs" class="core-tabs" selectTab="app.module.selectTab">

	<div title="${module.MODULE_NAME}" style="padding:10px;">
		<form id="itemForm" class="core-form c2" type="item">
		 	<input type="hidden" name="${config['module.idCol']}" /> 
		 	<input type="hidden" name="SJZT" />
			<table>
				<tr>
				  <td>用户名称：</td>
				  <td><input name="USER_NAME" class="disabled check ${user.USER_RIGHT==9?'text':'' }" req="false" readonly></td>
				</tr>
				<tr>
				  <td>登录账号：</td>
				  <td><input name="USER_ACCOUNT" class="disabled check ${user.USER_RIGHT==9?'text':'' }"  req="false" readonly></td>
				</tr>
				<tr>
				  <td>所属机构：</td>
				  <td><input name="ORGAN_NAME" class="disabled check text" readonly> </td>
				</tr>
				<tr>
				  <td>用户角色：</td>
				  <td>
				  	<select name="ROLE_ID"  req="false" disabled>
					  <option value="-1">--请选择--</option>
					  	<c:forEach items="${roles }" var="role">
					  		<option value="${role.ROLE_ID}">${role.ROLE_NAME}</option>
					  	</c:forEach>
					  </select>
				  </td>
				</tr>
				<tr>
				  <td>联系电话：</td>
				  <td><input name="USER_PHONE" class="disabled check ${user.USER_RIGHT==9?'text':'' }"  req="false" readonly></td>
				</tr>
				<tr>
				  <td >联系邮箱：</td><td>
				  <input name="USER_EMAIL" class="disabled check ${user.USER_RIGHT==9?'text':'' }"  req="false" readonly></td>
				</tr>
				<!-- <tr>
				  <td >用户备注：</td>
				  <td><textarea name="USER_REMARK"  class="disabled" readonly rows="5"  style="width:99%" ></textarea></td>
				</tr> -->
				<tr>
					<td>职务：</td>
					<td><input name="ZW" class="disabled check ${user.USER_RIGHT==9?'text':'' }"  req="false" readonly></td>
				</tr>
				<tr>
					<td>职称：</td>
					<td><input name="ZC" class="disabled check ${user.USER_RIGHT==9?'text':'' }"  req="false" readonly></td>
				</tr>
				<c:if test="${map:isNotEmpty(module_rights) }">
				<tr>
					<td colspan="2">
					<c:if test="${map:has(module_rights,'B-G-E') }">
						<c:if test="${user.USER_RIGHT==8 }">
							<a class="core-button" icon="icon-add" id="add" onclick="app.module.add()">添加</a>
						</c:if>
						<a class="core-button" icon="icon-edit" id="edit" style="display: none;" onclick="app.module.edit($(this))">编辑</a>
						<a class="core-button" icon="icon-del" id="del" style="display: none;" onclick="app.module.del($(this))">删除</a>
						<a class="core-button form-button" style="display: none;" icon="icon-save" id="save" onclick="app.module.save()">保存</a>
						<a class="core-button form-button" style="display: none;" icon="icon-cancel" id="cancel" onclick="app.module.cancel($(this))">撤销</a>
					</c:if>
					<c:if test="${map:has(module_rights,'B-G-L') }">
						<a class="core-button" icon="icon-lock" id="lock" style="display: none;"  onclick="app.module.lock($(this))">激活</a>
						<a class="core-button" icon="icon-unlock" id="unlock" style="display: none;"  onclick="app.module.unlock($(this))">取消激活</a>
					</c:if>
					</td>
			  </tr>
			  </c:if>
			</table>
			<jsp:include page="/commons/commons_module_item_info_one.jsp"></jsp:include>
		</form>
	</div>
	<c:if test="${user.USER_RIGHT==8 }">
		<div title="管理权限" style="padding:10px;">
			<ul class="core-tree" id="listOrgans" url="<%=basepath %>/${config['module.namespace']}/listOrgans"  checkbox="true" nameCol="ORGAN_NAME" idCol="ORGAN_NO" pidCol="ORGAN_NO_PRE" listParams="app.module.listDatailParams"></ul>
			<c:if test="${map:has(module_rights,'B-G-E') }">
				<div class="blank5"></div>
				<a class="core-button" style="float:right" icon="icon-edit" id="reOrganRight" style="display: none;" onclick="app.module.reOrganRight($(this))">授权</a>
			</c:if>
		</div>
	</c:if>
	<div title="系统权限" style="padding:10px;">
		<ul class="core-tree" id="listModules" url="<%=basepath %>/${config['module.namespace']}/listModules"  checkbox="true" nameCol="MODULE_NAME" idCol="MODULE_NO" pidCol="MODULE_NO_PRE" listParams="app.module.listDatailParams"></ul>
		<c:if test="${map:has(module_rights,'B-G-E') }">
			<div class="blank5"></div>
			<a class="core-button" style="float:right" icon="icon-edit" id="reModuleRight" style="display: none;" onclick="app.module.reModuleRight($(this))">授权</a>
		</c:if>
	</div>
	<c:if test="${user.USER_RIGHT==9 }">
		<div title="分配权限" style="padding:10px;">
			<ul class="core-tree" id="listFpModules" url="<%=basepath %>/${config['module.namespace']}/listFpModules"  checkbox="true" nameCol="MODULE_NAME" idCol="MODULE_NO" pidCol="MODULE_NO_PRE" listParams="app.module.listDatailParams"></ul>
			<c:if test="${map:has(module_rights,'B-G-E') }">
				<div class="blank5"></div>
				<a class="core-button" style="float:right" icon="icon-edit" id="reFpModuleRight" style="display: none;" onclick="app.module.reFpModuleRight($(this))">授权</a>
			</c:if>
		</div>
	</c:if>
	<div title="监察项" style="padding:10px;">
			<ul class="core-tree" id="listJcxs" url="<%=basepath %>/${config['module.namespace']}/listJcxs"  checkbox="true" nameCol="JCXXX_TJ" idCol="JCXXX_NO" pidCol="JCXXX_SJ" listParams="app.module.listDatailParams"></ul>
			<c:if test="${map:has(module_rights,'B-G-E') }">
				<div class="blank5"></div>
				<a class="core-button" style="float:right" icon="icon-edit" id="reJcxRight" style="display: none;" onclick="app.module.reJcxRight($(this))">授权</a>
			</c:if>
		</div>
		<div title="审查项" style="padding:10px;">
			<ul class="core-tree" id="listScxs" url="<%=basepath %>/${config['module.namespace']}/listScxs"  checkbox="true" nameCol="SCXXX_NR" idCol="SCXXX_NO" pidCol="SCXXX_SJ" listParams="app.module.listDatailParams"></ul>
			<c:if test="${map:has(module_rights,'B-G-E') }">
				<div class="blank5"></div>
				<a class="core-button" style="float:right" icon="icon-edit" id="reScxRight" style="display: none;" onclick="app.module.reScxRight($(this))">授权</a>
			</c:if>
		</div>
</div>
</div>
<div class="clear"></div>